/*
 * Categorization.java
 *
 * Created on April 9, 2007, 2:00 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package org.atomojo.app;

import java.net.URI;
import java.util.TreeMap;

/**
 *
 * @author alex
 */
public class Categorization extends TreeMap<URI,Object>
{
   public static String NIL = "rdf:nil";
   
   public static final URI CHILD_TERM = URI.create("http://www.atomojo.org/O/relations/child");
   public static final URI ANCESTOR_TERM = URI.create("http://www.atomojo.org/O/relations/ancestor");
   public static final URI FEED_TYPE_TERM = URI.create("http://www.atomojo.org/O/type/feed");
   public static final URI HIDDEN_TYPE_TERM = URI.create("http://www.atomojo.org/O/type/feed/hidden");
   public static final URI ENTRY_TYPE_TERM = URI.create("http://www.atomojo.org/O/type/entry");
   public static final URI TERM_TYPE_TERM = URI.create("http://www.atomojo.org/O/type/term");
   public static final URI DEFAULT_SCHEME = URI.create("http://www.atomojo.org/O/keyword/");
   public static final URI QUERY_TERM = URI.create("http://www.atomojo.org/O/type/query");
   public static final URI QUERY_NAME_TERM = URI.create("http://www.atomojo.org/O/type/query/name");
   public static final URI QUERY_USE_COLLECTION_TERM = URI.create("http://www.atomojo.org/O/type/query/use-collection");
   public static final URI QUERY_MEDIA_TYPE_TERM = URI.create("http://www.atomojo.org/O/type/query/media-type");
   
   /** Creates a new instance of Categorization */
   public Categorization()
   {
   }
   
   public boolean hasTerm(URI term)
   {
      return get(term)!=null;
   }
   
   public boolean hasCategory(URI term)
   {
      return get(term)==Nil.getInstance();
   }
   
   public void categorize(URI term)
   {
      put(term,Nil.getInstance());
   }
   
}
